package com.ruyuan.gateway.server.model;

import com.alibaba.nacos.common.utils.CollectionUtils;
import com.google.common.collect.Sets;
import org.apache.shiro.authz.permission.DomainPermission;

import java.util.Set;

/**
 * @author xx
 */
public class ApiPermission extends DomainPermission {

    public ApiPermission(Set<String> authorityCodes) {
        if (CollectionUtils.isNotEmpty(authorityCodes)) {
            super.setActions(authorityCodes);
        } else {
            super.setActions(Sets.newHashSet("NO_PERMISSION"));
        }
    }


}
